package com.mc.common.designpattern.signleton;

public class Singleton2 {
    //饿汉式2  如果一直不使用会造成对象自愿浪费
    private static final Singleton2 SINGLETON_1;

    static {
        SINGLETON_1 = new Singleton2();

    }

    private Singleton2() {
    }

    public static Singleton2 getInstance() {
        return SINGLETON_1;
    }
}
